
package com.centriole.serviceLog.entity;


import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Log {

	private String level;

	private String appId;

	private String appName;

	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	private String user;

	private String message;

	public String getUser() {
		return user;
	}
	public void setUser(String user) {
		this.user = user;
	}

	public String getLevel() {
		return level;
	}
	public void setLevel(String level) {
		this.level = level;
	}

	public Date getDate() {
		return createTime;
	}

	public void setDate(Date createTime) {
		this.createTime = createTime;
	}

	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}


	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public Log() {}
	public Log(String level, Date date, String user, String message) {
		this.level = level;
		this.createTime = date;
		this.user = user;
		this.message = message;
	}
	public Log(String user, String message) {
		this.level = "INFO";
		this.createTime = new Date();
		this.user = user;
		this.message = message;
	}


	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "log [level=" + level + ", date=" + createTime + ", message=" + message + ",user=" + user +"]";
	}




}

